home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
pc_board
/
pcbss30.zip
/
NEWUSER.ZIP
/
NEWUSER.DEF
< prev
Wrap
Text File
|
1992-11-23
|
31KB
|
778 lines
; The next line includes the file SS.CFG (located in the home path of
; SS.EXE). This file can contain anything that you want included or
; processed for each file that you include it in. For example, it can
; contain field definitions that are considered global to all scripts that
; are run. The SS.CFG as provided is setup to define fields that contain
; directory references for use by the sample scripts. You need to edit the
; SS.CFG file (in the same directory as SS.EXE) before running any of the
; the sample scripts.
;
; NOTE: If you do not store your SS.CFG file in the same directory as
; SS.EXE, or if you call this file something else, you may specify the
; path directly and not use the "@ss_cfig@" macro. You may also not
; include the file at all if you have no need for it's contents.
;
include @ss_cfig@
; Include the FIELDS and FORMAT definitions for use with the caller history
; file. This is used to store the information that the caller answers in
; this script. The file is a dBase III+ format file, and the record key is
; the caller name.
;
include @%SS_DEF_DIR "\callhist.fil"
;
; Define the fields needed for this script
;
FIELDS
;----------------------------------------------------------------------
; Name Type Len Prec Min Mask Default Value
;----------------------------------------------------------------------
Option C 1 0 1 *
AnyKey C 1 0 0 *
YesOrNo C 1 0 1 Y
isLong C 1 0 1 Y N
wasAbort C 1 0 1 Y N
xphone C 13 0 13 (999)999-9999
Cmnt1 C 55 0 0 *
Cmnt2 C 55 0 0 *
Cmnt3 C 55 0 0 *
area C 5 0 0 *
exch C 5 0 0 *
pnum C 5 0 0 *
modem C 60 0 0 * "ATDT "
msgSUBJ C 30 0 0 *
msgTITL C 60 0 0 *
wasnew C 1 0 0 N N
cdate C 8 0 0 *
ctime C 8 0 0 *
pw C 12 0 0 PPPPPPPPPPPP
pw_cnt N 1 0 0 9 0
topl C 1 0 0 * "┌"
topr C 1 0 0 * "┐"
botl C 1 0 0 * "└"
botr C 1 0 0 * "┘"
up C 1 0 0 * "│"
mid C 77 0 0 * "─────────────────────────────────────────────────────────────────────────────"
hline C 79 0 0 * "───────────────────────────────────────────────────────────────────────────────"
kbStfFile C 78 0 0 *
ssTxtOut C 1 0 0 Y
ssTxtFile C 48 0 0 *
ssCallLog C 1 0 0 Y
ssCallBack C 1 0 0 Y
ssLongDist C 1 0 0 Y
ssSubScribe C 1 0 0 Y
FIELDS
;
;--------------------------------------------------------------------------
;--------------------------------------------------------------------------
;
set kbStfFile @%PCBDRIVE @%PCBDIR "\pcbstuff.kbd"
set ssTxtOut Y
set ssTxtFile @ss_path@ "log\newcall.log"
set ssCallLog Y
set ssCallBack Y
set ssLongDist N
set ssSubScribe Y
beeps off ;
flush_kb ;
color bright cyan black ;set crt colors
entry_min_attr bright red black ;
entry_max_attr bright blue black ;
entry_ans_attr bright yellow black ;
;
; open caller history file
;
open 1 ssLogDir CALLHIST ;
if @file_stat@ != "*OK*" ;chk for err
create 1 HistFmt ssLogDir CALLHIST ;env var pts to dir
if @file_stat@ != "*OK*" ;chk for err
text "CANNOT CREATE CALLHIST FILE" ;
goto AbortJob ;
endif ;
endif ;
if ssCallLog == "Y"
log_msg @user@ " accessed CallBackDoor"
endif
;
; check the caller history file to see if this caller has been
; in this door before.
;
read 1 HistFmt ;read caller hist file for this caller
if @file_stat@ == "*OK*" ;was it found?
set wasnew N
gosub Listit ; yes; display and prompt
else
set wasnew Y
gosub NewCaller
endif ;not found, new caller
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; main prompt line
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
Prompt:
display 17 1 "@X0B" hline "@X07"
set Option
setmask Option "<ALEXalex>"
accept 18 1 "@X0ECommand: @X0BA@X03ccept, @X0BL@X03ist, @X0BE@X03dit " Option
ucase Option
switch Option
case "A"
goto CallBack
case "L"
gosub Listit ; yes; display and prompt
break
case "E"
newline 2
gosub GetData
break
case "X"
goto AbortJob ; quit script
endswitch
goto Prompt
;---------------------------------------------------------------------------
; Call Back Routine
;---------------------------------------------------------------------------
CallBack:
if ssCallBack != "Y"
goto SubScribe
endif
; if @port@ == 0
; goto SubScribe
; endif
gosub Header
display 5 5 "Which number should we call you back at?"
display 6 5 ""
display 7 5 "1.. @X0B" Phone
display 8 5 "2.. @X0B" Fax
display 9 5 "3.. @X0BEnter a different number now"
display 10 5 ""
display 11 5 " <ESC> aborts"
gosub Footer
esc_chk ON ;turn escape checking on
set Option ;set var to null
setmask Option "<123>" ;set entry mask
esc_to CBFail ;set esc latch
accept 14 5 " @X0ESelect:@X03 " Option ;get caller input
esc_to ;reset esc latch
switch Option ;test caller entry
case "1" ;
set Num2Call Phone ;
break ;
case "2" ;
set Num2Call Fax ;
break ;
case "3" ;
set xphone ;
esc_to CallBack ;
accept 14 5 "@X0EEnter number to call:@X03 " xphone ;
esc_to ;reset esc latch
set Num2Call xphone ;
break ;
endswitch ;
;
; Check phone number and ask caller if it's ok
;
parsephone Num2Call area exch pnum ;bust up phone num
trim area exch pnum ;trim space from flds
if exch == "000" ;chk for fake #'s
goto InvalidPhoneNum ;
endif ;
if pnum == "0000" ;chk for fake #'s
goto InvalidPhoneNum ;
endif ;
switch area ;chk area code
case "" ;if null,
case "813" ; or our are code
set isLong 'N' ; then not LD
set Num2Call exch "-" pnum ; build call number
break ;chk 'exch' now (fall thru)
case "800" ;handle 800 #'s
set isLong 'N' ; not LD
set Num2Call "1(" area ")" exch "-" pnum ; build call number
goto IsPhoneNumOk ;
dcase ;default case
set isLong 'Y' ; assume any other AC is LD
set Num2Call "1(" area ")" exch "-" pnum ; build call number
goto IsPhoneNumOk ;
endswitch
switch exch ;chk exchange code for
case "858" ; #'s that are in our
case "859" ; area code but still
case "754" ; long distance.
case "756" ; add lines as needed.
set isLong 'Y' ;set ld flag
set Num2Call "1-" exch "-" pnum ; build call number
endswitch
;
; ask caller if the phone number we just built is ok
;
IsPhoneNumOk:
if ssLongDist == 'N' ;if not allow LD
if isLong == 'Y' ; and it's a LD #
goto NoLD ; err out
endif ;
endif ;
gosub Header
display 5 5 "We are about to call you back at the following number:"
display 6 5 ""
display 7 5 " " Num2Call
gosub Footer
set YesOrNo ;set var to null
esc_to CallBack ;set esc latch
accept 10 5 " Is this correct?: " YesOrNo ;get caller input
esc_to ;reset esc latch
if YesOrNo == "N" ;if caller said NO
goto CallBack ; go back to prev prompt
endif ;
write 1 HistFmt ;write
update_user_record ;update the user record with new
gosub Header
display 5 5 "Call back procedure started."
display 6 5 ""
display 7 5 "Your modem will ring in a few seconds (10 to 30). When you see"
display 8 5 "the word RING on your screen, type 'ATA'<ENTER> and you will"
display 9 5 "be re-connected to QExchange."
display 10 5 ""
display 11 5 "NOTE: Most modems will support auto answer. To set this option"
display 12 5 " enter 'ATS0=1'<ENTER>. This works for most modems. If you"
display 13 5 " elect to use this feature of your modem, you do not need"
display 14 5 " to use the ATA method above."
gosub Footer
;
; start the callback proc now...
;
esc_chk OFF ;turn escape checking off
set modem modem Num2Call
callbacK 45 modem
if @shell_stat@ == 0
goto CBFail
endif
;
; callback went ok - get the caller password to verify who it is
;
set pw_cnt 1
GetPW:
gosub Header
display 5 5 "Please enter your password below"
display 6 5 "Attempt Number:" pw_cnt
if pw_cnt == 3
display 7 5 "This is your last try!"
endif
gosub Footer
set pw
accept 10 5 "Password:" pw
trim pw
ucase pw
if pw != @password@
if pw_cnt == 3
goto pwFail
endif
add pw_cnt pw_cnt 1
goto GetPW
endif
;
; password was entered ok. let 'em in....
;
goto SubScribe
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
SubScribe:
if ssSubScribe != "Y"
goto JobDone
endif
gosub Header
display 5 5 "Which Credit Card will you be using?"
display 6 5 ""
display 7 5 "V.. @X0B Visa"
display 8 5 "M.. @X0B MasterCard"
display 9 5 "D.. @X0B Discover"
display 10 5 "A.. @X0B American Express"
display 11 5 ""
display 12 5 " <ESC> aborts"
gosub Footer
set Option ;set var to null
setmask Option "<VMDAvmda>" ;set entry mask
esc_chk ON ;turn escape checking on
esc_to SubScribeFail ;set esc latch
accept 15 5 " @X0ESelect:@X03 " Option ;get caller input
esc_to ;reset esc latch
esc_chk OFF ;turn escape checking OFF
ucase Option
set CardType Option
switch CardType ;
case "A" ;
setmask CardNum "9999 999999 99999" ;amex
break ;
case "V" ;
setmask CardNum "9999 9999 9999 9999" ;visa
break ;
case "M" ;
setmask CardNum "9999 9999 9999" ;mastercard ???
break ;
case "D" ;
setmask CardNum "9999 99 999999 9999" ;discover ???
break ;
dcase
goto SubScribe
endswitch ;
;---------------------------------------------------------------------------
GetCardNum:
gosub Header
display 5 5 "Enter your card number now"
gosub Footer
set CardNum ;set var to null
accept 8 5 "@X0ECard Number:@X03 " CardNum ;get caller input
trim CardNum
if CardNum == ""
goto SubScribe
endif
validcreditcard CardNum Option
if Option == ""
goto GetCardNum
endif
switch Option ;convert to letter code
case "3" ;
set Option "A" ;amex
break ;
case "4" ;
set Option "V" ;visa
break ;
case "5" ;
set Option "M" ;mastercard
break ;
case "6" ;
set Option "D" ;discover
break ;
dcase
goto GetCardNum
endswitch ;
if Option != CardType
goto GetCardNum
endif
;---------------------------------------------------------------------------
GetCardDate:
gosub Header
display 5 5 "Enter the expiration date"
gosub Footer
set CardDate ;set var to null
setmask CardDate "99/99" ;set var mask
accept 8 5 "@X0EExpire Date:@X03 " CardDate ;get caller input
trim CardDate
if CardDate == "/"
goto GetCardNum
endif
goto JobDone
;---------------------------------------------------------------------------
SubScribeFail:
set wasAbort 'Y'
set msgSUBJ "Subscription Aborted"
set msgTITL "Subscription Aborted"
gosub DoMsg
goto EndIt
;---------------------------------------------------------------------------
pwFail:
set wasAbort 'Y'
set msgSUBJ "Password entry failed"
set msgTITL "Password entry failed"
gosub DoMsg
goto EndIt
;---------------------------------------------------------------------------
; goofball caller entered bad #.
; yell at 'em
;---------------------------------------------------------------------------
InvalidPhoneNum:
text ""
set AnyKey ;set var to null
setmask AnyKey "*" ;set entry mask
prompt "Invalid phone number. Press <ENTER> to continue." AnyKey
goto CallBack
;---------------------------------------------------------------------------
; long distance not allowed
;---------------------------------------------------------------------------
NoLD:
gosub Header
display 5 5 "@X0E" xphone "@X03 appears to be a long distance phone number."
display 6 5 "Long distance callback is not supported."
display 7 5 ""
display 8 5 "1...Enter different phone number."
display 9 5 "2...Leave comment to Sysop and hangup".
display 10 5 "3...Hangup now".
gosub Footer
set Option ;set var to null
setmask Option "<123>" ;set entry mask
accept 13 5 "Option : " Option ;get caller input
switch Option ;test caller entry
case "1" ;
goto CallBack
case "2" ;
goto Cmnt2Sysop
case "3" ;
goto NoLDmsg
endswitch ;
goto NoLD
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
Cmnt2Sysop:
esc_chk ON ;turn escape checking on
esc_to CmntMsg ;set esc latch
gosub Header
display 5 5 ""
display 6 5 "Enter up to 3 lines of text. Press <ESC> when done."
display 7 5 ""
gosub Footer
if @graphics@ == 0
prompt "1:" Cmnt1
prompt "2:" Cmnt2
prompt "3:" Cmnt3
goto Cmnt2Sysop
else
FORMAT MsgFmt
Cmnt1
Cmnt2
Cmnt3
FORMAT
getmsg MsgFmt 13 12 3 55
endif
CmntMsg:
esc_chk OFF ;turn escape checking off
esc_to ;reset esc latch
; if @firstu@ != "SYSOP"
MSG
"SYSOP" ;to
"SYSOP" ;from
"LD Comment" ;subject
"Comment" ;security
"Main Board" ;conf
"Long distance comment" ;1st line of msg
"Node: " @node@ " Baud Rate: " @bps@ " " @sysdate@ " " @systime@
"-------------------------------------------------------"
" Name: " @user@ " Age: " Age
"City,ST: " CitySt
" Phone: " Phone
" Occup: " Occup
" How: " How
"-------------------------------------------------------"
"1:" Cmnt1
"2:" Cmnt2
"3:" Cmnt3
MSG
; endif
set wasAbort 'Y'
goto EndIt
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
NewCaller:
display_file ssDefDir INFO.TXT ;display this file
clearcrt
indent 5
display 1 5 ""
display 2 5 "@X09┌───────────────────────────────────────────────────────────────────┐"
display 3 5 "@X09│ @X0B**** QExchange Bulletin Board **** @X09 │"
display 4 5 "@X09├───────────────────────────────────────────────────────────────────┤"
display 5 5 "@X09│ │"
display 6 5 "@X09│ @X0BYou are in the new caller login section. After completing the @X09 │"
display 7 5 "@X09│ @X0Bquestions below, you will be returned to the main bulletin board.@X09 │"
display 8 5 "@X09│ │"
display 9 5 "@X09│ @X0BThis is a one-time procedure. Estimated time to complete this @X09 │"
display 10 5 "@X09│ @X0Bquestionnaire is 2 to 4 minutes. @X09 │"
display 11 5 "@X09│ │"
display 12 5 "@X09├───────────────────────────────────────────────────────────────────┤"
display 13 5 "@X09│ │"
display 14 5 "@X09│ @X0FNOTE: @X07If you do not wish to complete the questionnaire at @X09 │"
display 15 5 "@X09│ @X07this time, you may press <ESC> at the 'Name' field @X09 │"
display 16 5 "@X09│ @X07prompt. @X09 │"
display 17 5 "@X09│ │"
display 18 5 "@X09└───────────────────────────────────────────────────────────────────┘"
display 19 5 ""
display 20 5 ""
indent 0
if @graphics@ == '1'
force_enter
endif
gosub GetData
return
;---------------------------------------------------------------------------
; get caller data
;---------------------------------------------------------------------------
GetData:
; color bright cyan black ;set attr
color cyan black
gosub DspDataTitles
esc_chk ON ;turn escape checking on
esc_to AbortJob ;set esc latch
accept 5 5 " Name@X08: @X0B" Name
esc_to ;reset esc latch
esc_chk OFF ;turn escape checking off
;
; prompt for rest of data fields
;
accept 6 5 " Company@X08: @X0B" Company
accept 7 5 " Address@X08: @X0B" Addr
accept 8 5 " City, State@X08: @X0B" CitySt
accept 9 5 " Zip@X08: @X0B" Zip
accept 10 5 " Country@X08: @X0B" Country
accept 11 5 " Phone Number@X08: @X0B" Phone
accept 12 5 " Fax/Data Number@X08: @X0B" Fax
accept 13 5 " Your Age@X08: @X0B" Age
if @graphics@ == '0'
newline
endif
accept 15 5 " Your occupation@X08: @X0B" Occup
accept 16 5 " How did you hear of QExchange?@X08: @X0B" How
accept 17 5 " What type of PC do you use?@X08: @X0B" PCType
accept 18 5 " PC NetWork (if you use one)@X08: @X0B" NetWork
color bright cyan black ;set attr
gosub Listit
if wasnew == Y
curDate 5 / cdate
curTime 5 ctime
set AddDate cdate
set AddTime ctime
endif
write 1 HistFmt
gosub LogData
return
;---------------------------------------------------------------------------
; display data entry field titles if in graphics mode
;---------------------------------------------------------------------------
DspDataTitles:
if @graphics@ == '1'
clearcrt
display 1 1 "@X0B" topl mid topr "@X07"
display 2 1 "@X0B" up "@X1F User Information Profile Entry @X0B" up
display 3 1 "@X0B" botl mid botr "@X07"
display 5 5 " Name@X08: @X0B"
display 6 5 " Company@X08: @X0B"
display 7 5 " Address@X08: @X0B"
display 8 5 " City, State@X08: @X0B"
display 9 5 " Zip@X08: @X0B"
display 10 5 " Country@X08: @X0B"
display 11 5 " Phone Number@X08: @X0B"
display 12 5 " Fax/Data Number@X08: @X0B"
display 13 5 " Your Age@X08: @X0B"
display 15 5 " Your occupation@X08: @X0B"
display 16 5 " How did you hear of QExchange?@X08: @X0B"
display 17 5 " What type of PC do you use?@X08: @X0B"
display 18 5 " PC NetWork (if you use one)@X08: @X0B"
display 20 1 "@X0B""hline""@X07"
endif
return
;---------------------------------------------------------------------------
; list caller data
;---------------------------------------------------------------------------
Listit:
clearcrt
color bright cyan black
display 1 1 "@X0B" topl mid topr "@X07"
display 2 1 "@X0B" up "@X1F User Information Profile @X0B" up
display 3 1 "@X0B" botl mid botr "@X07"
color cyan black
display 4 1 ""
display 5 1 " Name@X08: @X0B" Name
display 6 1 " Company@X08: @X0B" Company
display 7 1 " Address@X08: @X0B" Addr
display 8 1 " City, State, Zip, Country@X08: @X0B" CitySt " " Zip " " Country
display 9 1 " Phone Number@X08: @X0B" Phone " @X03Fax/Data: " @X0B Fax
display 10 1 ""
display 11 1 " Your Age@X08: @X0B" Age
display 12 1 " Occupation@X08: @X0B" Occup
display 13 1 " How you heard of QExchange@X08: @X0B" How
display 14 1 " PC Type@X08: @X0B" PCType
display 15 1 "PC NetWork (if you use one)@X08: @X0B" NetWork
return
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
Header:
clearcrt
display 1 1 "@X0B" topl mid topr "@X07"
display 2 1 "@X0B" up "@X1F Call Back Procedure @X0B" up
display 3 1 "@X0B" botl mid botr "@X07"
display 4 1 ""
indent 5
return
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
Footer:
if @graphics@ == '1'
text ""
endif
text ""
indent 0
text "@X0B" hline "@X07"
return
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
LogData:
if wasnew == N
return
endif
if ssTxtOut == "N"
return
endif
LOG_DATA ssTxtFile
"---------------------------------------------------------------------"
" Date: " @sysdate@
" Time: " @systime@
" Node: " @node@
" Name: " Name
" Company: " Company
" Address: " Addr
" City, State, Zip, Country: " CitySt " " Zip " " Country
" Phone Number: " Phone " Fax/Data: " Fax
""
" Age: " Age
" Occupation: " Occup
" How you heard of?: " How
" PC Type: " PCType
"PC NetWork (if you use one): " NetWork
LOG_DATA
return
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
JobDone:
write 1 HistFmt ;write
update_user_record ;update the user record with new
gosub Header
display 5 5 "Logon procedure complete."
display 6 5 ""
display 7 5 "Your account on this system has been updated to full access"
display 8 5 "You may call back at any time to enjoy these privilages."
display 9 5 ""
display 10 5 "Thanks for your call!"
gosub Footer
color bright white black
if @security@ < 10
increase 1 10
endif
set msgSUBJ "New User Called"
set msgTITL "New User Logon"
gosub DoMsg
goto EndIt
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; callback failed
;---------------------------------------------------------------------------
CBFail:
set isLong 'N'
write 1 HistFmt
update_user_record ;update the user record with new
set msgSUBJ "CallBack FAILED"
set msgTITL "@X8CFAILED@X0B Callback."
gosub DoMsg
goto EndIt
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; script was aborted
;---------------------------------------------------------------------------
AbortJob:
set wasAbort 'Y'
set msgSUBJ "New User Abort"
set msgTITL "@X8CAborted@X0B script."
gosub DoMsg
goto EndIt
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; long distance # not allowed
;---------------------------------------------------------------------------
NoLDmsg:
set wasAbort 'Y'
set msgSUBJ "Long Distance Num"
set msgTITL "Long distance number used in call back script."
gosub DoMsg
goto EndIt
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
DoMsg:
; if @firstu@ != "SYSOP"
MSG
"SYSOP" ;to
"SYSOP" ;from
msgSUBJ ;subject
"Comment" ;security
"Main Board" ;conf
msgTITL ;1st line of msg
"Node: " @node@ " Baud Rate: " @bps@ " " @sysdate@ " " @systime@
"--------------------------------------------------"
"Callback Verification: " ssCallBack
" Allow Long Distance: " ssLongDist
" Called #: " Num2Call
" Subscription Active: " ssSubScribe
" Card Type: " CardType " Card #:" CardNum " exp Date:" CardDate
"--------------------------------------------------"
" Name: " @user@ " Age: " Age
"City,ST: " CitySt
" Phone: " Phone
" Occup: " Occup
" How: " How
MSG
; endif
return
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; close up files and exit back to pcboard
;---------------------------------------------------------------------------
EndIt:
close 1
if ssCallBack == "Y"
if isLong == "Y"
goodbye
exit
endif
; if wasAbort == "Y"
; goodbye
; exit
; endif
endif
;
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; If you would like to 'stuff' the keyboard of the caller upon return
; to pcboard, uncomment the following lines. This example will 'stuff'
; the word "menu", causing the menu to be displayed when the caller returns
; to pcboard.
;
; You might want to use something like "R Y S" to force the caller to read
; any new mail you might have left him/her in the door.
;---------------------------------------------------------------------------
; if kbStfFile exist ;if kb stuff file exist,
; dos "del " kbStfFile ; erase it
; endif ;
; log_data kbStfFile ;create kb stuff file
; "menu" ; dsp menu
; log_data ;end
;---------------------------------------------------------------------------
exit